<?php
class MapAction extends HomeAction{
  public function show(){
		$params = array();
		$params['id'] = !empty($_GET['id']) ? trim($_GET['id']):'rss';
		$params['page'] = !empty($_GET['p']) ? intval($_GET['p']) : 1;
		$params['limit'] = !empty($_GET['limit']) ? intval($_GET['limit']):30;
		$params['siteDomain'] = C('site_domain');

		$this->assign($params);
		$this->display('Map:'.$params['id'],'utf-8','text/xml'); 
	}

	public function index(){

      // 获取视频总数
        $vodCnt = M('vod')->count();
        $pageSize = 1000;
        $pageCount = ($vodCnt+$pageSize-1) / $pageSize;

        $pages = range(1,$pageCount);

        $params = array();
        $params['id'] = !empty($_GET['id']) ? trim($_GET['id']):'rss';
        $params['id'] =$params['id'].'index';
        $params['pages'] = $pages;
        $params['pageSize'] = $pageSize;
        $params['siteDomain'] = C('site_domain');


        $this->assign($params);
        $this->display('Map:'.$params['id'],'utf-8','text/xml');
    }

}
?>